<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 门店照片
 */
class CreateWxStorePhoto extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wx_store_photos', function (Blueprint $table) {
            $table->increments('id')->comment('序号');
            $table->unsignedInteger('sid')->comment('门店ID');
            $table->unsignedTinyInteger('type')->default(0)->comment('照片类型,0:门店照片,1:营业执照,2:相关证明材料');
            $table->string('view_url', 200)->default('')->comment('图片访问地址');
            $table->string('wx_media_id', 150)->default('')->comment('微信mediaId');
            $table->string('wx_view_url', 200)->default('')->comment('微信访问地址');
            $table->softDeletes();
            $table->timestamps();
            $table->index(['sid'],'index1');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wx_store_photos');
    }
}
